
@echo off
set workspace=%~dp0
set venv=D:\zhh\venv\Scripts
::必要的库目录
set libPath=D:\zhh\venv\Lib\site-packages\PyQt5\Qt\bin;D:\zhh\venv\Lib\site-packages\PyInstaller;D:\zhh\venv\Lib\site-packages\xlrd;D:\zhh\venv\Lib\site-packages\xlwt
::执行的脚本
set scriptPath=%workspace%\tsMaker.py
::exe图标文件
set iconPath=%workspace%\assets\ico_exe\logo.ico

::版本信息文件
set versionPath=%workspace%\assets\file_version_info.txt
::exe文件名
set exeName=H5GUI
::build目录
set workpath=%workspace%\build
cd ..
set preFolder=%cd%
::dist目录 也就是生成的exe文件保存目录
set distPath=%preFolder%\dist

cd %workspace%
::删除旧版本
del /a /f /q %distPath%\H5GUI*.exe 

set from=%workspace%\assets
set to=%preFolder%\dist\assets\
del /a /f /q %to%
xcopy /e /s /h /f /y %from% %to% 

::在e盘 进入d的环境目录
cd /d %venv%
::cd到目录后 执行命令 这里是执行Python的进入虚拟目录的命令 cmd \k 不能同时执行&连接的两个命令 
start /b activate & pyinstaller --icon=%iconPath% --path %libPath% --distpath %distPath% --version-file=%versionPath% -n=%exeName% --workpath %workpath% --clean -Fw %scriptPath%




